package cn.rokhdelar.umbrsapi.core.utils;

/**
 * @description 对象为空的判断
 */
public class NullUtil
{

	/**
	 * 判断是否为NULL
	 * 
	 * @param obj
	 * @return
	 */
	public static final boolean isNull(Object obj)
	{
		if (null == obj)
		{
			return true;
		}
		else
		{
			return false;
		}
	}

	/**
	 * 判断是否为Not NULL
	 * 
	 * @param obj
	 * @return
	 */
	public static final boolean isNotNull(Object obj)
	{
		if (null != obj)
		{
			return true;
		}
		else
		{
			return false;
		}
	}

	public static final boolean isEmpty(Object obj)
	{
		if (null == obj || "".equals(obj))
		{
			return true;
		}
		else
		{
			return false;
		}
	}

	public static final boolean isNotEmpty(Object obj)
	{
		if (null != obj && !"".equals(obj) && !" ".equals(obj))
		{
			return true;
		}
		else
		{
			return false;
		}
	}

	/**
	 * 判断是否为非空
	 */
	public static boolean isNotNullOrEmpty(Object obj) {
		return !isNullOrEmpty(obj);
	}

	/**
	 * 判断是否为空
	 */
	public static boolean isNullOrEmpty(Object obj) {
		return null == obj || "".equals(obj) || "null".equals(obj) || " ".equals(obj);
	}

}
